package com.ruoyi.statistics.service;

import com.ruoyi.statistics.domain.BoardDist;
import com.ruoyi.statistics.domain.OverviewDTO;
import com.ruoyi.statistics.domain.QuShi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.article.mapper.articleMapper;
import com.ruoyi.board.mapper.BoardMapper;
import com.ruoyi.userSystem.mapper.UserMapper;

import java.util.List;

@Service
public class StatisticsService {

    @Autowired
    private articleMapper article;

    @Autowired
    private BoardMapper boardMapper;

    @Autowired
    private UserMapper userMapper;


    public List<QuShi> getQuShi() {
        return article.getQuShi();
    }

    public List<BoardDist> getBoardDist() {
        return boardMapper.getBoardDist();
    }

    public OverviewDTO getOverview() {
        OverviewDTO overviewDTO = new OverviewDTO();
        overviewDTO.setUserCount(userMapper.getUserCount());
        overviewDTO.setPostCount(article.getPostCount());
        overviewDTO.setBoardCount(boardMapper.getBoardCount());
        return overviewDTO;
    }
}
